package com.linkgie.galaxyframework.service.account.web;

import javax.validation.constraints.NotBlank;

import com.linkgie.galaxyframework.metadata.DataEntity;
import com.linkgie.galaxyframework.metadata.DataField;
import com.linkgie.galaxyframework.metadata.DataInterface;
import com.linkgie.galaxyframework.metadata.DataKey;
import com.linkgie.galaxyframework.metadata.DataLabel;
import com.linkgie.galaxyframework.security.AccountIdentity;

@DataInterface
@DataEntity
public class AccountBriefVO implements AccountIdentity, AccountBriefVI {

	@NotBlank
	@DataKey
	@DataField(name = "Id", order = 0, readonly = true)
	private String id;

//	@NotBlank
//	@DataField(name = "账号", order = 1)
//	private String username;

	@NotBlank
	@DataLabel
	@DataField(name = "名称", order = 3)
	private String name;


	@DataField(name = "公钥地址", order = 4)
	private String pkAddress;

	@DataField(name = "公钥", order = 5)
	private String publicKey;

	public AccountBriefVO() {
	}

	public AccountBriefVO(AccountIdentity record) {
		this.id = record.getId();
		this.name = record.getName();
		this.publicKey = record.getPublicKey();
		this.pkAddress = record.getPkAddress();
//		this.username = record.getUsername();
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the pkAddress
	 */
	@Override
	public String getPkAddress() {
		return pkAddress;
	}

	/**
	 * @param pkAddress the pkAddress to set
	 */
	public void setPkAddress(String pkAddress) {
		this.pkAddress = pkAddress;
	}

	@Override
	public String getPublicKey() {
		return publicKey;
	}

	@Override
	public void setPublicKey(String publicKey) {
		this.publicKey = publicKey;
	}


//	@Override
//	public String getUsername() {
//		return username;
//	}
//
//
//	@Override
//	public void setUsername(String username) {
//		this.username = username;
//	}


	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

}
